<!DOCTYPE html>
<html >
<head>
    <meta charset="utf-8">
    <title>JVM监控</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <link rel="stylesheet" href="css/monitor.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<blockquote class="layui-elem-quote layui-text font16" id="ipAndHost">
    thread-id :<span id="threadId"></span>
</blockquote>
<pre class="layui-code" id="threadDetailHtml"  lay-title="java">
</pre>

<script src="js/jquery-3.4.0.min.js" charset="utf-8"></script>
<script src="layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript"  >

    function getUrlParam(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg); //匹配目标参数
        if (r!=null) return unescape(r[2]); return null; //返回参数值
    }
    // 启动类
    $(function () {
        var threadid= getUrlParam('id');
        $("#threadId").html(threadid);
        $.ajax({
            type: "GET",
            url: "v1/api/thread/detail.json?id=" + threadid,
            dataType: "json",
            success: function(data){
                if(data.code == 200){
                    // 显示内容
                    $("#threadDetailHtml").html(data.data || "空")
                }else if(data.code == 400){
                    $("#threadDetailHtml").html(data.message)
                }
            }
        });
    });

</script>
</body>
</html>